/*
 * @Descripttion: 
 * @version: 
 * @Author: Jun
 * @Date: 2021-06-02 10:20:00
 * @LastEditors: Jun
 * @LastEditTime: 2021-06-02 14:30:16
 */
// 获取localStorage
export const getStorage = (key)=>{
    return localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : null
}

// 设置localStorage
export const setStorage = (key,value)=>{
    if(typeof value === "string"){
        localStorage.setItem(key,value)
    }else{
        localStorage.setItem(key,JSON.stringify(value))
    }
}

// 删除设置localStorage
export const removeStorage = (key)=>{
    localStorage.removeItem(key)
}

// 清空localStorage
export const clearStorage = ()=>{
    localStorage.clear()
}